<!DOCTYPE html>
<html>
<head>
    <title>require.js: Layers Test</title>
    <script type="text/javascript" src="../../require.js"></script>
    <script type="text/javascript" src="../doh/runner.js"></script>
    <script type="text/javascript" src="../doh/_browserRunner.js"></script>
    <script type="text/javascript">
    var master = new doh.Deferred();
    doh.register(
        "layers",
        [
            {
                name: "layers",
                timeout: 5000,
                runTest: function() {
                    return master;
                }
            }
        ]
    );
    doh.run();

    require(
        {
            baseUrl: "./"
        },
        ["require", "layer1"],
        function(require) {
            require(["alpha", "beta", "gamma", "epsilon"],
                function(alpha, beta, gamma, epsilon) {
                    doh.is("alpha", alpha.name);
                    doh.is("beta", alpha.betaName);
                    doh.is("beta", beta.name);
                    doh.is("gamma", beta.gammaName);
                    doh.is("gamma", gamma.name);
                    doh.is("epsilon", gamma.epsilonName);
                    doh.is("epsilon", epsilon.name);

                    var regExp = /alpha|beta|gamma/,
                        i,
                        scripts = document.getElementsByTagName("script");
                    for (var i = scripts.length - 1; i > -1; i--) {
                        doh.f(regExp.test(scripts[i].src));
                    }
                    master.callback(true);
                }
            );
        }
    );
    </script>
</head>
<body>
    <h1>require.js: Layers Test</h1>
    <p>Check console for messages</p>
</body>
</html>
